package com.yc.springcloud.service;

import com.yc.springcloud.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author DELL
 * @Date 2024/11/20 16:40
 * @Version 1.0
 */

@FeignClient(value = "seata-account-micor-server")
public interface AccountService {

	/**
	 * 1. 远程调用的方式为 Post
	 * 2. 远程调用的 url 为 http://服务名/路径
	 * 3. 服务名 是 注册中心服务
	 * 4. 会根据 OpenFeign 的均衡算法来决定是调用
	 * 减少库存
	 * @param userId
	 * @param money
	 * @return
	 */
	@PostMapping(value = "/account/reduce")
	Result reduce(@RequestParam("userId") Long userId, @RequestParam("money") Integer money);
}
